package com.black.web.controller.my.orders;

import com.black.app.domain.req.my.myorders.MyOrdersQueryReq;
import com.black.app.domain.resp.my.myorders.MyOrdersQueryResp;
import com.black.app.service.store.AppStoreOrdersService;
import com.black.common.core.controller.BaseController;
import com.black.common.core.domain.R;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "后台-我的订单相关Api")
@RestController
@RequestMapping("/admin/my/orders")
public class OrdersController extends BaseController {
   @Autowired
    private AppStoreOrdersService myOrdersService;

    /**
     * 我的订单列表(后台)
     * @param req
     * @return
     */
    @PreAuthorize("@ss.hasPermi('my:orders:list')")
    @ApiOperation(value = "订单列表")
    @GetMapping(value = "/data")
    public R<PageInfo<MyOrdersQueryResp>> list(MyOrdersQueryReq req)
    {
        PageInfo<MyOrdersQueryResp> page = this.myOrdersService.paginationQuery(req);
        return R.ok(page);
    }
}
